---
apiVersion: v1
kind: Namespace
metadata:
  name: externalservice-namespace

---
apiVersion: v1
kind: Service
metadata:
  name: externalservice-http-server
  namespace: externalservice-namespace
spec:
  ports:
    - port: 10080
      name: http
      appProtocol: http
      targetPort: 8080
  selector:
    app: externalservice-http-server

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: externalservice-http-server
  namespace: externalservice-namespace
  labels:
    app: externalservice-http-server
spec:
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  selector:
    matchLabels:
      app: externalservice-http-server
  template:
    metadata:
      labels:
        app: externalservice-http-server
    spec:
      containers:
        - name: echo-server
          image: mendhak/http-https-echo:23
          imagePullPolicy: IfNotPresent
          readinessProbe:
            httpGet:
              path: /
              port: 8080
            initialDelaySeconds: 3
            periodSeconds: 3
          ports:
            - containerPort: 8080
          resources:
            limits:
              cpu: 50m
              memory: 128Mi
